cmake_minimum_required(VERSION 3.16)

project(kafka_test VERSION 1.0 LANGUAGES CXX)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
	if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        message("MSYS2 should run pacman -S ..librdkafka first. We assume the packages has been installed.")
	else()
		message("Using build-in librdkafka.")
        include_directories(${PROJECT_SOURCE_DIR}/../../3rdlibs/rdkafka)
	    link_directories(${PROJECT_SOURCE_DIR}/../../3rdlibs/rdkafka)
	endif()
endif()


set(CMAKE_INCLUDE_CURRENT_DIR ON)


set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


set(PRJ_HEADERS
	common_example_kafka.h
)

set(PRJ_SOURCES
	consumer.cpp
	main.cpp
	producer.cpp
)

set(PRJ_RESOURCES
)
# ========================Exe========================

add_executable(rdkafka_test
	${PRJ_HEADERS}
	${PRJ_SOURCES}
	${PRJ_RESOURCES}
)

target_link_libraries(rdkafka_test PRIVATE
	rdkafka
)


